		<div class="fr">
<?php if ( is_home() && !is_paged() ): ?>
			<div class="user-list">
				<ul class="cycle">
<?php
// 浅爱墙
global $wpdb;
// 执行数据库查询
$counts = $wpdb->get_results("SELECT COUNT(comment_author) AS cnt, user_id, comment_author, comment_author_url, comment_author_email
	FROM {$wpdb->prefix}comments
	WHERE comment_date > date_sub( NOW(), INTERVAL 30 DAY ) 
		AND comment_approved = '1' 
		AND comment_type = ''
		AND user_id > 0
	GROUP BY comment_author_email
	ORDER BY cnt DESC
	LIMIT 28");
$mostactive = '';
if ( $counts ) {
// 输出列表       
	foreach ($counts as $count) {
		$mostactive .= '<li class="hov-tip" title="' . get_the_author_meta( 'display_name', $count->user_id ) .' 最近30天发表了 '. $count->cnt . ' 条评论">' . get_avatar($count, 40) . '</li>';
	}
	echo $mostactive;
}
?>
				</ul>
				<div class="online"><a href="http://wwmm.me/2011/09/1330.html" target="_blank">浅爱头像设置指南</a></div>
			</div>
<?php endif; ?>
			<div class="box text-list">
				<h2>热门</h2>
				<?php
				$result = $wpdb->get_results("select p.ID as ID,p.post_title as post_title,pm.meta_value as meta_value from $wpdb->posts as p join $wpdb->postmeta as pm on p.ID=pm.post_id where pm.meta_key='views' and p.post_type='post' and p.post_status='publish' and DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(p.post_date) order by CONVERT(pm.meta_value,SIGNED) DESC limit 0,16");
				$count = count($result);
				if( $count > 0 ):
					$i = 0;
					$li_list = '';
					foreach ( $result as $value ){
						setup_postdata( $value );
						$postid = $value -> ID;
						$title = $value -> post_title;
						$views = $value -> meta_value;
						$i++;

						$li_list .= '<li><a rel="bookmark" href="' . get_permalink($postid) . '" title="'.$views.' 次浏览">' . $title . '</a></li>';
					}
				?>
				<ul><?php echo $li_list; ?></ul>
				<?php endif; ?>
			</div>
			<div id="MidSpread1" class="spread cycle"><script type="text/javascript">BAIDU_CLB_fillSlot("450086");</script></div>
			<div id="MidSpread2" class="spread cycle"><script type="text/javascript">BAIDU_CLB_fillSlot("405488");</script></div>
		</div>
